﻿using SuperX.Common.Helper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace SuperX.Common.AppConfiguration
{
    // 
    public class LogCfg
    {
        // 
        public string IP { get; set; }

        // 
        public int Port { get; set; }

        // 
        public bool IsPullIOTLog { get; set; }

        //
        public string IOTLogServerIp { get; set; }

        // 
        public int IOTLogServerPort { get; set; }

        // 
        public string LocalLogPath { get; set; } = "";

        // 
        public int LogCacheTime { get; set; } = 7;

        // 
        public int DetailLogCacheTime { get; set; } = 2;

        // 
        public string WebApipushUrl { get; set; } = "http://127.0.0.1:7682/LogRecord/Append";

        // 
        public string Filter { get; set; } = "";

        // 
        public bool IsSeparateDetailLog { get; set; } = true;

        // 
        public LogCfg()
        {
            this.IP = IPUtil.GetLocalIPV4();
            this.IOTLogServerIp = IPUtil.GetLocalIPV4();
            this.Port = 2020;
            this.LocalLogPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "IOT");
            this.IOTLogServerPort = 7670;
        }
    }
}
